package cn.iocoder.yudao.module.wine.dal.mysql.membertype;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.wine.dal.dataobject.membertype.MemberTypeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wine.controller.admin.membertype.vo.*;

/**
 * 会员类型信息 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface MemberTypeMapper extends BaseMapperX<MemberTypeDO> {

    default PageResult<MemberTypeDO> selectPage(MemberTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MemberTypeDO>()
                .likeIfPresent(MemberTypeDO::getName, reqVO.getName())
                .eqIfPresent(MemberTypeDO::getPrice, reqVO.getPrice())
                .betweenIfPresent(MemberTypeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(MemberTypeDO::getId));
    }

}